14a7a5df78c7d25ef38236882a66ebeb412fda2d,community/server/src/functionaltest/java/org/neo4j/server/rest/PathsFunctionalTest.java,PathsFunctionalTest,shouldBeAbleToFetchSingleShortestPath,#,182

Before Change


    public void shouldBeAbleToFetchSingleShortestPath() throws JsonParseException
    {
        long[] nodes = createMoreComplexGraph();
        Client client = Client.create();

        // Get single shortest path
        WebResource resource = client.resource( functionalTestHelper.nodeUri(nodes[ 0 ]) + "/path" );
        ClientResponse response = resource.type( MediaType.APPLICATION_JSON ).accept( MediaType.APPLICATION_JSON ).entity( getAllShortestPathPayLoad( nodes[1] ) ).post( ClientResponse.class );
        assertEquals( 200, response.getStatus() );
        Map<?, ?> path = (Map<?, ?>)JsonHelper.jsonToMap( response.getEntity( String.class ) );
        assertTrue( path.get( "start" ).toString().endsWith( "/node/" + nodes[ 0 ] ) );
        assertTrue( path.get( "end" ).toString().endsWith( "/node/" + nodes[ 1 ] ) );
        assertEquals( 2, path.get( "length" ) );

After Change


        long[] nodes = createMoreComplexGraph();

        // Get single shortest path
        ClientResponse response = postPathQuery( nodes, getAllShortestPathPayLoad( nodes[ 1 ] ), "/path" );

        Map<?, ?> path = JsonHelper.jsonToMap( response.getEntity( String.class ) );
        assertTrue( path.get( "start" ).toString().endsWith( "/node/" + nodes[ 0 ] ) );
        assertTrue( path.get( "end" ).toString().endsWith( "/node/" + nodes[ 1 ] ) );
        assertEquals( 2, path.get( "length" ) );